<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
    <title>悦章科技机构平台</title>
    <!--内容样式-->
    <link rel="stylesheet" href="__PUBLIC__/Home/css/style.css" />
    <link rel="stylesheet" href="__PUBLIC__/Home/css/page.css" />

        <style>
        .shadowLayer{
            position: absolute;
            /*position: relative;*/
            top: 0;
            left: 0;
            z-index: 501;
            width: 100%;
            height:100%;
            display: -webkit-flex;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color:rgba(0,0,0,0.75);

           
        }
        .shadowLayer .qrImage{
            width: 400px;
            height: 400px;
            background-color: #fff;
        }
    </style>
</head>
<body>
 <div class="shadowLayer">
    <div class="qrImage"></div>
 </div>
<div class="main">
    <!--  头部  -->
    <include file="menu" />

    <!--  右侧内容  -->
    <div class="content">
        <div class= "ct-title">
            <div class="ctt-bt">代购记录</div>
            <div class="ctt-r">
                <form class="cttr-bd" action="{:U('Home/Purchasing/purchasingAgentList')}" method="post">
                    <input type="text" placeholder="请输入学生身份证号码" class="cttrb-wb" name="id_card" value="{$id_card}">
                    <div class="cttrb-sj">
                        <input type="date" name="start_time" value="{$start_time}">
                        <img src="__PUBLIC__/Home/images/img_zhi.png" />
                        <input type="date" name="end_time" value="{$end_time}">
                        <div class="divclear"></div>
                    </div>
                    <button class="cttrb-cx">查询</button>
                    <a href="{:U('Home/Purchasing/addPurchasingAgent')}" class="cttrb-xz">新增代购</a>
                    <div class="divclear"></div>
                </form>
                <div class="divclear"></div>
            </div>
            <div class="divclear"></div>
        </div>

        <div class="ct-table">
            <table width="100%" border="0">
                <tbody>
                <tr>
                    <th scope="col" width="8%" style="border-top-left-radius: 10px;">学生姓名</th>
                    <th scope="col" width="12%">身份证号</th>
                    <th scope="col" width="8%">虚拟帐号</th>
                    <th scope="col" width="12%">代购时间</th>
                    <th scope="col" width="23%">课程名称</th>
                    <th scope="col" width="8%">代购类型</th>
                    <th scope="col" width="8%">费用</th>
                    <th scope="col" width="8%">状态</th>
                    <th scope="col" width="13%" style="border-top-right-radius: 10px;">操作</th>
                </tr>
                <volist name="_list" id="vo">
                    <tr>
                        <td>{$vo.username}</td>
                        <td>{$vo.id_card}</td>
                        <td>
                            <if condition="$vo['id_account'] neq ''">
                                {$vo.id_account}
                                <else/>
                                无
                            </if>
                        </td>
                        <td>{$vo.create_time|date='Y-m-d H:i',###}</td>
                        <td>{$vo.name}</td>
                        <td>
                            <if condition="$vo['type'] eq 1">
                                直播课
                                <elseif condition="$vo['type'] eq 2"/>
                                面授课
                                <else/>
                                在线课
                            </if>
                        </td>
                        <td>￥{$vo.pay_price}</td>
                        <td><if condition="$vo['is_pay'] eq 0">未支付<else/>已支付</if></td>
                        <td>
                            <if condition="$vo['is_pay'] eq 0"><a onclick="cc('{$vo.id}')">立即支付</a></if>
                            <a href="{:U('Home/Purchasing/delPurchasingAgent',array('id'=>$vo['id']))}">删除</a>
                        </td>
                    </tr>
                </volist>
                </tbody>
            </table>
        </div>

        <div class="page">
            {$_page}
        </div>
        <!--<div class="ct-btn">
            <div class="ctb-an"><</div>
            <div class="ctb-an ctb-an-on">1</div>
            <div class="ctb-an">2</div>
            <div class="ctb-an">3</div>
            <div class="ctb-an">></div>
            <div class="divclear"></div>
        </div>-->
    </div>
</div>
</body>
</html>
<script src="/Public/static/jquery-2.0.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $('.shadowLayer').hide();
});
function cc(id){
    var url = "{:U('Home/Purchasing/pay_order')}";
    $.ajax({
        url:url,
        data:{id:id},
        type:"POST",
        success: function(data){
            var dataObj = JSON.parse(data);
            var tt='<img src="'+dataObj.info+'" />';
            $('.qrImage').html(tt);
            $('.shadowLayer').show();
            setTimeout(function(){
                location.href="{:U('Home/Purchasing/purchasingAgentList')}";
            },9000);
        }
    })
}
</script>